package com.zero.demo.jms.util;

import com.zero.demo.jms.dao.DynamicCompDao;
import com.zero.demo.jms.entity.DynamicCompDto;
import com.zero.demo.jms.util.cache.AbstractEhCache;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author zengzr
 * @desc
 * @Date 2019/5/5 17:44
 */
@Component
@Log4j2
public class BusiDynamicCompCacheUtils  extends AbstractEhCache<DynamicCompDto> {

    @Autowired
    DynamicCompDao dynamicCompDao;


    public DynamicCompDto getById(Long id) {
        return dynamicCompDao.findById(id).get();
    }

    public String getBodyById(Long id) {
        return dynamicCompDao.findById(id).get().getCompContent();
    }

    @Override
    public void initCache() {
        //TODO:初始化缓存
    }
}
